﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using IOEntity;
using IODataAccess;
namespace IOBusiness
{
    public class clsBSInfomationContent
    {
        clsDAInfomationContent obj = new clsDAInfomationContent();
        public clsInfomationContent GetById(int id)
        {
            try
            {
                return obj.GetById(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<clsInfomationContent> GetAll()
        {
            try
            {
                return obj.GetAll();
            }
            catch (Exception)
            {

                throw;
            }

        }
        public List<clsInfomationContent> GetByLoai(int loaiid)
        {
            try
            {
                return obj.GetByLoai(loaiid);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<clsInfomationContent> GetByLoai(int loaiid,int id)
        {
            try
            {
                List<clsInfomationContent> obj = new List<clsInfomationContent>();
                obj = this.obj.GetByLoai(loaiid);
                for (int i = 0; i < obj.Count; i++)
                {
                    if (obj[i].Id == id)
                    {
                        obj.RemoveAt(i);
                    }
                }
                return obj;
            }
            catch (Exception)
            {

                throw;
            }
        }
        public List<clsInfomationContent> GetByTop(int top)
        {
            try
            {
                return obj.GetByTop(top);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public int Insert(clsInfomationContent obj)
        {
            try
            {
                return this.obj.Insert(obj);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void Update(clsInfomationContent obj)
        {
            try
            {
                this.obj.Update(obj);
            }
            catch (Exception)
            {

                throw;
            }
        }
        public void Delete(int id)
        {
            try
            {
                this.obj.Delete(id);
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
